package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.CirculationB226;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class CirculationB226Converter implements AttributeConverter<CirculationB226, String> {
    @Override
    public String convertToDatabaseColumn(CirculationB226 circulationB226) {
        return JSONUtil.toJsonStr(circulationB226);
    }

    @Override
    public CirculationB226 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, CirculationB226.class);
    }
}
